import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:macnov/pie/PieChartWidget.dart';

class TestPie extends StatefulWidget {
  @override
  _TestPieState createState() => _TestPieState();
}

class _TestPieState extends State<TestPie> {
  List<double> angles = [3 / 7, 1 / 7, 1 / 7, 1 / 14, 3 / 14];

  List<Color> colors = [
    Colors.red,
    Colors.cyan,
    Colors.black,
    Colors.yellow,
    Colors.grey
  ];
  List<String> contents = ["梁朝伟", "刘德华", "郭富城", "周星驰", "张学友"];

  @override
  Widget build(BuildContext context) {
    return Center(
        child: PieChartWidget(angles, colors,
            startTurns: .0,
            radius: MediaQuery.of(context).size.width / 2 * 0.9,
            contents: contents));
  }
}
